package com.summer.oauth.center.controller;

import com.summer.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.summer.oauth.center.service.RbacServiceImpl.RESOURCE_CACHE_PREFIX;

@RestController
@RequestMapping("/cache")
public class RedisController {

    @Autowired
    private RedisUtil redisUtil;

    @RequestMapping("/clearPermissions")
    public boolean clearPermissions(){
        redisUtil.delete(RESOURCE_CACHE_PREFIX+"*");
        return true;
    }
}
